public class ClientClass {
    public static void main(String[] args){
        // 获取单例工厂（多次调用返回同一实例）
        Factory factory1 = Factory.getInstance();
        Factory factory2 = Factory.getInstance();
        System.out.println(factory1 == factory2); // 输出：true

        // 创建水果对象
        Fruit fruit = factory1.CreateFruit("A");
        fruit.eat(); // 输出：eat Apple
    }
}